# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=manticore
pkgver=0.3.7.r82.gfe2ac403
pkgrel=1
pkgdesc='Symbolic execution tool.'
arch=('any')
groups=('blackarch' 'blackarch-binary')
url='https://github.com/trailofbits/manticore'
license=('AGPL3')
depends=('python' 'python-yaml' 'python-protobuf' 'python-pysha3' 'python-cbor2'
         'python-prettytable' 'python-ply' 'python-rlp' 'python-intervaltree'
         'python-crytic-compile' 'python-wasm' 'python-dataclasses'
         'python-pyevmasm' 'python-z3-solver' 'python-capstone' 'python-unicorn'
         'python-pyelftools' 'python-redis')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/trailofbits/$pkgname.git")
md5sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" *.md docs/*.rst

  cp -a docs/images "$pkgdir/usr/share/doc/$pkgname/"

  find "$pkgdir" -type f -iname '*.pyc' -print -exec rm -f {} \;
}

